//
//  Present.h
//  Advance_MVC
//
//  Created by Willian on 2021/5/2.
//

#import <Foundation/Foundation.h>

#import "UserModel.h"

typedef void(^DataLoadSuccessBlock)(NSMutableArray * _Nonnull resArr);

NS_ASSUME_NONNULL_BEGIN

@class MVCMainView;
@protocol PresentDelegate <NSObject>

@optional
//UI -> model
- (void)changeUserAge:(int)age withIndex:(NSInteger)index;
//点击了某一行cell  UI -> Model
- (void)selectCellWithIndex:(NSInteger)index;

//model -> UI
- (void)obtainDataAfterResreshUI:(MVCMainView *)mainView;

@end


@interface Present : NSObject<PresentDelegate>

/// 初始化 Present 对象
/// @param dataLoadSuccessBlock 数据加载完后的回调
- (instancetype)initWithMainView:(MVCMainView *)mainView  withDataLoadSuccessBlock:(DataLoadSuccessBlock)dataLoadSuccessBlock;

@end

NS_ASSUME_NONNULL_END
